package com.xiaoxi.buildermode.diretor;

import com.xiaoxi.buildermode.builder.IBuilder;

import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName Director
 * @Description
 * @Author xiaoxi
 * @Date 2023/3/12 15:54
 * @Version 1.0
 */
public class Director {

    private IBuilder iBuilder;

    public Director(IBuilder iBuilder) {
        this.iBuilder = iBuilder;
    }

    public void printContent() {
        iBuilder.makeTitle("Greeting");
        iBuilder.makeString("早上");
        List<String> morning = new ArrayList<>();
        morning.add("面包");
        morning.add("牛奶");
        iBuilder.makeItems(morning);
        iBuilder.makeString("中午");
        List<String> noon = new ArrayList<>();
        noon.add("鱼香肉丝");
        noon.add("可乐");
        iBuilder.makeItems(noon);
        iBuilder.makeString("晚上");
        List<String> evening = new ArrayList<>();
        evening.add("炸鸡");
        evening.add("雪碧");
        iBuilder.makeItems(evening);
        iBuilder.close();
    }

}
